import _fetch from './request'
import store from '@/store'
// 面试技巧列表
function articlesTechnic () {
  return _fetch({
    url: '/articles/technic',
    needToken: store.state.isLogin
  })
}
// 市场数据
function chartDataHot () {
  return _fetch({
    url: '/chart-data/hot'
  })
}
// 面经分享
function articlesShare (params) {
  return _fetch({
    url: '/articles/share',
    params
  })
}
// 面经热搜
function ShareTopSearch () {
  return _fetch({
    url: '/articles/shareTopSearch'
  })
}
// 面经详情
function articlesShareInfo (id) {
  return _fetch({
    url: '/articles/share/' + id
  })
}
// 面经评论
function articlesComments (id, params) {
  return _fetch({
    url: '/articles/comments/' + id,
    params
  })
}
// 发表评论
function toArticlesComments (data) {
  return _fetch({
    url: '/articles/comments',
    needToken: true,
    method: 'post',
    data
  })
}
// 收藏文章
function articlesCollect (data) {
  return _fetch({
    url: '/articles/collect',
    method: 'post',
    needToken: true,
    data
  })
}
// 点赞文章
function articlesStar (data) {
  return _fetch({
    url: '/articles/star',
    method: 'post',
    needToken: true,
    data
  })
}
// 评论点赞
function articleCommentsStar(data){
  return _fetch({
    url:'/article-comments/star',
    method:'post',
    needToken:true,
    data
  })
}
export {
  articleCommentsStar,
  articlesStar,
  articlesTechnic,
  chartDataHot,
  articlesShare,
  ShareTopSearch,
  articlesShareInfo,
  articlesComments,
  toArticlesComments,
  articlesCollect
}
